package view;

import java.awt.Color;
import java.awt.Graphics;

import javax.swing.JPanel;

import utils.Parameters;

public class KoalaGlassPane extends JPanel {

	public static boolean DISPLAY_GRID = false;

	public KoalaGlassPane() {
		super();
	}

	@Override
	protected void paintComponent(Graphics g) {
		super.paintComponent(g);
		KoalaLayeredPane pane = MainFrame.getInstance().getDrawingPane();
		int startX = pane.getX() + 3;
		int startY = pane.getY() + 25;
		int endX = startX + pane.getWidth();
		int endY = startY + pane.getHeight();
		if (DISPLAY_GRID) {
			
			g.setColor(Color.GRAY);

			
			for (int i = startX; i < endX; ++i) {
				if (i % Parameters.GRID_SIZE == 0)
					g.drawLine(i, startY, i, endY);
			}
			for (int j = startY; j < endY; ++j) {
				if (j % Parameters.GRID_SIZE == 0)
					g.drawLine(startX, j, endX, j);
			}
		}
		g.drawRect(startX, startY, endX-startX, endY-startY);
		
	}

}
